package org.familysearch.fsapi.gwt.server.api;

import org.apache.log4j.Logger;
import org.familysearch.fsapi.gwt.common.client.entities.Person;
import org.familysearch.fsapi.gwt.server.bo.BOException;
import org.familysearch.fsapi.gwt.server.bo.PersonBO;

public class PersonAPI extends API {

	private PersonBO bo = new PersonBO();
	private Logger log;
	
	public PersonAPI()
	{
		super();
		log = Logger.getLogger(this.getClass().getName());
	}
	
	public Person getPerson(Person Person) throws APIException
	{
		Person fetched = null;
		try
		{
			fetched = bo.getPerson(Person);
		}
		catch(BOException e)
		{
			log.error(e.toString());
			APIException ex = new APIException("API-0001", "Could not retrieve person.");
			throw ex;
		}
		return fetched;
		
	}
	
}
